package com.hanry.command;

import com.hanry.Utils;

/**
 */
public class ValueBit {
	public static final int ZERO = 0x00;
	public static final int ONE = 0x0F;
	private int valueByte = 0;
	
	public ValueBit(){

	}
	
	public ValueBit(int valueByte) {
		this.valueByte = valueByte;
	}
	
	public byte[] getBytes(){
		return new byte[]{(byte) this.valueByte};
	}
	public int getValueByte() {
		return valueByte;
	}

	public void setValueByte(int valueByte) {
		this.valueByte = valueByte;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + valueByte;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ValueBit other = (ValueBit) obj;
		if (valueByte != other.valueByte)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return Utils.castBytesToHexString(this.getBytes());
	}
	
}
